/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Verito Ramirez
 *         Victor Jaramillo
 */
@Entity
@Table(name = "cxp_cabeceraretencion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CxpCabeceraRetencion.findAll", query = "SELECT c FROM CxpCabeceraRetencion c"),
    @NamedQuery(name = "CxpCabeceraRetencion.findBycxpCodigoCabret", query = "SELECT c FROM CxpCabeceraRetencion c WHERE c.cxpCodigoCabret = :cxpCodigoCabret"),
    @NamedQuery(name = "CxpCabeceraRetencion.findBycxpFechaEmisionCabret", query = "SELECT c FROM CxpCabeceraRetencion c WHERE c.cxpFechaEmisionCabret = :cxpFechaEmisionCabret"),
    @NamedQuery(name = "CxpCabeceraRetencion.findBycxpFechaRetencion", query = "SELECT c FROM CxpCabeceraRetencion c WHERE c.cxpFechaEmisionCabret between :conInicio and :conFin"),
    @NamedQuery(name = "CxpCabeceraRetencion.findBycxpTipoComprobanteCabret", query = "SELECT c FROM CxpCabeceraRetencion c WHERE c.cxpTipoComprobanteCabret = :cxpTipoComprobanteCabret"),
    @NamedQuery(name = "CxpCabeceraRetencion.findBycxpNumeroCabret", query = "SELECT c FROM CxpCabeceraRetencion c WHERE c.cxpNumeroCabret = :cxpNumeroCabret"),
    @NamedQuery(name = "CxpCabeceraRetencion.findBycxpObservacionCabret", query = "SELECT c FROM CxpCabeceraRetencion c WHERE c.cxpObservacionCabret = :cxpObservacionCabret"),
    @NamedQuery(name = "CxpCabeceraRetencion.findBycxpNumeroDocCabret", query = "SELECT c FROM CxpCabeceraRetencion c WHERE c.cxpNumeroDocCabret = :cxpNumeroDocCabret"),
    @NamedQuery(name = "CxpCabeceraRetencion.findBycxpCodigoTipDoc", query = "SELECT c FROM CxpCabeceraRetencion c WHERE c.cxpCodigoTipDoc = :cxpCodigoTipDoc"),
    @NamedQuery(name = "CxpCabeceraRetencion.findBycxpCodigoEstRet", query = "SELECT c FROM CxpCabeceraRetencion c WHERE c.cxpCodigoEstRet = :cxpCodigoEstRet")})

public class CxpCabeceraRetencion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "CXP_CODIGO_CABRET")
    private String cxpCodigoCabret;
    @Column(name = "CXP_FECHAEMISION_CABRET")
    @Temporal(TemporalType.DATE)
    private Date cxpFechaEmisionCabret;    
    @Size(max = 15)
    @Column(name = "CXP_TIPOCOMPROBANTE_CABRET")
    private String cxpTipoComprobanteCabret;
    @Size(max = 45)
    @Column(name = "CXP_NUMERO_CABRET")
    private String cxpNumeroCabret;
    @Size(max = 300)
    @Column(name = "CXP_OBSERVACION_CABRET")
    private String cxpObservacionCabret;
    @Size(max = 45)
    @Column(name = "CXP_NUMERODOC_CABRET")
    private String cxpNumeroDocCabret;
    @JoinColumn(name = "CXP_CODIGO_TIPDOC", referencedColumnName = "CXP_CODIGO_TIPDOC")
    @ManyToOne(optional = false)
    private CxpTipoDocumento cxpCodigoTipDoc;
    @JoinColumn(name = "CXP_CODIGO_ESTRET", referencedColumnName = "CXP_CODIGO_ESTRET")
    @ManyToOne(optional = false)
    private CxpEstadoRetencion cxpCodigoEstRet;

    public CxpCabeceraRetencion() {
    }

    public CxpCabeceraRetencion(String cxpCodigoCabret) {
        this.cxpCodigoCabret = cxpCodigoCabret;
    }

    public String getCxpCodigoCabret() {
        return cxpCodigoCabret;
    }

    public void setCxpCodigoCabret(String cxpCodigoCabret) {
        this.cxpCodigoCabret = cxpCodigoCabret;
    }

    public CxpEstadoRetencion getCxpCodigoEstRet() {
        return cxpCodigoEstRet;
    }

    public void setCxpCodigoEstRet(CxpEstadoRetencion cxpCodigoEstRet) {
        this.cxpCodigoEstRet = cxpCodigoEstRet;
    }

    public CxpTipoDocumento getCxpCodigoTipDoc() {
        return cxpCodigoTipDoc;
    }

    public void setCxpCodigoTipDoc(CxpTipoDocumento cxpCodigoTipDoc) {
        this.cxpCodigoTipDoc = cxpCodigoTipDoc;
    }

    public Date getCxpFechaEmisionCabret() {
        return cxpFechaEmisionCabret;
    }

    public void setCxpFechaEmisionCabret(Date cxpFechaEmisionCabret) {
        this.cxpFechaEmisionCabret = cxpFechaEmisionCabret;
    }

    public String getCxpNumeroCabret() {
        return cxpNumeroCabret;
    }

    public void setCxpNumeroCabret(String cxpNumeroCabret) {
        this.cxpNumeroCabret = cxpNumeroCabret;
    }

    public String getCxpNumeroDocCabret() {
        return cxpNumeroDocCabret;
    }

    public void setCxpNumeroDocCabret(String cxpNumeroDocCabret) {
        this.cxpNumeroDocCabret = cxpNumeroDocCabret;
    }

    public String getCxpObservacionCabret() {
        return cxpObservacionCabret;
    }

    public void setCxpObservacionCabret(String cxpObservacionCabret) {
        this.cxpObservacionCabret = cxpObservacionCabret;
    }

    public String getCxpTipoComprobanteCabret() {
        return cxpTipoComprobanteCabret;
    }

    public void setCxpTipoComprobanteCabret(String cxpTipoComprobanteCabret) {
        this.cxpTipoComprobanteCabret = cxpTipoComprobanteCabret;
    }

   
    

    
    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cxpCodigoCabret != null ? cxpCodigoCabret.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CxpCabeceraRetencion)) {
            return false;
        }
        CxpCabeceraRetencion other = (CxpCabeceraRetencion) object;
        if ((this.cxpCodigoCabret == null && other.cxpCodigoCabret != null) || (this.cxpCodigoCabret != null && !this.cxpCodigoCabret.equals(other.cxpCodigoCabret))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "emprsss.CxpCabeceraRetencion[ cxpCodigoCabret=" + cxpCodigoCabret + " ]";
    }
    
}
